from django.contrib import admin

# Register your models here.
from django.contrib import admin
from .models import UserProfile
admin.site.site_header = '买嗨管理后台'  # 设置header
admin.site.site_title = '买嗨管理后台'  # 设置title
admin.site.index_title = '买嗨管理后台'
from django.contrib.auth.admin import UserAdmin
class CustomUserAdmin(UserAdmin):
    fieldsets = (
        (None, {'fields': ('username', 'password')}),
        ('Personal info', {'fields': ('first_name', 'last_name', 'email','icon')}),
        ('Permissions', {'fields': ('is_active', 'is_staff', 'is_superuser')}),
    )
    add_fieldsets = (
        (None, {
            'classes': ('wide',),
            'fields': ('username', 'password1', 'password2'),
        }),
    )

# 注册自定义用户模型和管理类
admin.site.register(UserProfile, CustomUserAdmin)